package com.xiyu.service.controller.admin.customer;
import com.xiyu.service.vo.customer.customerCheck.CustomerCheckMergeInput;
import com.xiyu.service.vo.customer.customerCheck.CustomerCheckSettingEditInput;
import com.xiyu.service.vo.customer.customerCheck.CustomerCheckSettingQueryOutput;
import com.xiyu.service.vo.customer.customerCheck.CustomerCheckDuplicateSearchOutput;
import com.xiyu.service.vo.customer.customerCheck.CustomerCheckDuplicateSearchInput;
import org.springframework.web.bind.annotation.*;
import jakarta.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Operation;

import jakarta.validation.*;

import java.util.*;

import com.xiyu.service.framework.web.web.core.pojo.PageResult;
import com.xiyu.service.framework.web.web.core.pojo.CommonResult;
import static com.xiyu.service.framework.web.web.core.pojo.CommonResult.success;

import com.xiyu.service.framework.excel.core.util.ExcelUtils;

import com.xiyu.service.framework.operateLog.core.annotations.OperateLog;
import static com.xiyu.service.framework.operateLog.core.enums.OperateTypeEnum.*;

import com.xiyu.service.service.customer.CustomerCheckService;

@Tag(name = "客户查重")
@RestController
@RequestMapping("/customer/customer-check")
@Validated
public class CustomerCheckController {

    @Resource
    private CustomerCheckService customerCheckService;

    @PostMapping("/duplicate-search")
    @Operation(summary = "客户查重")
    public CommonResult<List<CustomerCheckDuplicateSearchOutput>> duplicateSearch(@Valid @RequestBody CustomerCheckDuplicateSearchInput inputVO) {
        return success(customerCheckService.duplicateSearch(inputVO));
    }

    @PostMapping("/setting-query")
    @Operation(summary = "查询设置字段")
    public CommonResult<List<CustomerCheckSettingQueryOutput>> settingQuery() {
        return success(customerCheckService.settingQuery());
    }

    @PostMapping("/setting-edit")
    @Operation(summary = "编辑设置字段")
    public CommonResult<Boolean> settingEdit(@Valid @RequestBody List<CustomerCheckSettingEditInput> inputVO) {
        return success(customerCheckService.settingEdit(inputVO));
    }

    @PostMapping("/merge")
    @Operation(summary = "客户合并")
    public CommonResult<Boolean> merge(@Valid @RequestBody CustomerCheckMergeInput inputVO) {
        return success(customerCheckService.merge(inputVO));
    }

}
